<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of MainView
 *
 * @author mateusz.ledzewicz
 */
class ViewTesting extends TestingScreen{
    //put your code here
        
    public function load() {
        parent::load();
        $this->chooseView('network');
        
    }
    
    protected function runLoad()
    {
        $networkIn = $this->specialVariables['networkIn'];
        $inputs = '';
        for($i = 0; $i<$networkIn; $i++)
        {
            $inputs .= '<label for="input['.$i.']">Wejście '.$i.'</label><input type="text" name="input['.$i.']">'."<br>\n";
        }
        
        $this->setVar('input', $inputs);
    }
    
    protected function testLoad() {
        $testing_data = $this->specialVariables['testing_data'];
        $options ='';
        foreach($testing_data as $file)
        {
            $options .= '<option value="'.$file->id_test_data.'">'.$file->name.' '.$file->dateTo.' '.$file->number.'</option>';
        }
        $this->setVar('options', $options);
    }
    
    
    protected function infoLoad() {
        $tests = $this->specialVariables['list'];
        
        $list = '
            <tr>
                <td>'.$this->getVar('header_Test_LABEL_id_network_teached').'</td>
                <td>'.$this->getVar('header_Test_LABEL_id_test_data').'</td>
                <td>'.$this->getVar('header_Test_LABEL_output').'</td>
                <td>Edycja</td>
            </tr>';
        
        foreach($tests as $r)
        {
            $list .= '
            <tr>
                <td>'.$r->id_network_teached.'</td>
                <td>'.$r->id_test_data.'</td>
                <td>'.$r->output.'</td>
                <td>
                    <a href="?step=charts&action=value&id_test='.$r->id_test.'"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span></a>
                </td>
            </tr>';     

         }
        
        $this->setVar('list', $list);
       
    }
    
   
    
    
  
}

?>
